<template>
  <div class="com-container">
    <div ref="flow" class="com-chart"></div>
  </div>
</template>

<script setup name="FlowCom">
import { shallowRef, onMounted, onBeforeUnmount } from 'vue'
import { useFlow } from '../hooks/useFlow'
const { initChart, screenAdapter, registerFlow } = useFlow()
const flow = shallowRef()
onMounted(() => {
  registerFlow(flow.value)
  initChart()
  window.addEventListener('resize', screenAdapter)
  screenAdapter()
})
onBeforeUnmount(() => {
  window.removeEventListener('resize', screenAdapter)
})
</script>

<style lang="less" scoped></style>
